#include <stdio.h>
#include <unistd.h>

#include "ohos_init.h"
#include "cmsis_os2.h"
#include "st7735s.h"

static void ST7735S_Task(void* arg)
{
    (void) arg;
    lcdInit();
    lcdClear(BLUE);
    LCD_Fill(20, 20, 50, 50, RED);
    return 0;
}

static void ST7735S_Entry(void)
{
    osThreadAttr_t attr;


    attr.name = "ST7735S_Task";
    attr.attr_bits = 0U;
    attr.cb_mem = NULL;
    attr.cb_size = 0U;
    attr.stack_mem = NULL;
    attr.stack_size = 1024 * 20;
    attr.priority = osPriorityNormal;

    if (osThreadNew(ST7735S_Task, NULL, &attr) == NULL) {
        printf("[ST7735S_Task] Falied to create ST7735S_Task!\n");
    }
}

SYS_RUN(ST7735S_Entry);
